package com.java.poc.iofile;

import java.io.File;
import java.io.IOException;

public class FilePathExample {

	public static void main( String[] args )
    {
    	try {

    	  String filename = "testing.txt";
    	  String finalfile = "";

    	  String workingDir = System.getProperty("user.dir");
    	  String your_os = System.getProperty("os.name").toLowerCase();

    	  finalfile = workingDir + File.separator + filename;

    	  System.out.println("Final filepath : " + finalfile);
    	  System.out.println(your_os);
    	  File file = new File(finalfile);

	  if (file.createNewFile()){
	     System.out.println("Done");
	  }else{
	     System.out.println("File already exists!");
	  }

    	} catch (IOException e) {
	      e.printStackTrace();
	}
    }

}
